package cn.gmy.day0721_JavaIO;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class BufferedWriterTwo {
	
	/**
	 * ��һ���ི���ǣ������ֽ��������濴�����ַ���:
	 */
	public static void main(String[] args) {		
		//��ô�ȿ�һ��API��BufferedWriter���췽���Ķ���
		try {
			/**
			 * ���С�������һ�������ͼ;
			 */
			
			BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\Users\\wang\\Desktop\\eat.txt"));
			BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\wang\\Desktop\\eat.txt"));
			String s = null;
			for(int i = 0; i < 100; i++) {
				s = String.valueOf(Math.random());
				bw.write(s);
				bw.newLine();//����ǻ��е���˼��ÿдһ���ַ����Ǿͻ�һ��
			}
			bw.flush();//���ؽ���	
			while((s = br.readLine()) != null) {//���ʱ������Ҫע�⣬BufferedReader��һ���ر���õķ������������readLine��һ��API�ĵ��Ľ���i
				System.out.println(s);//�ֿ�ʼ��ȡ		
			}
			bw.close();
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
